<form action="{:url()}" method="post" class="form_single">
    <div class="box">
      <div class="box-body">
        <div class="row">
		 {if empty($info)}
		  <div class="col-md-6">
            <div class="form-group">
              <label>店主</label>
              （<span id="dian" style="color:red">无</span>）
              <input class="form-control" name="username" placeholder="请输入门店店主" value="{$info['username']|default=''}" type="text">
            </div>
          </div> 
		  {/if}
        <div class="col-md-6">
            <div class="form-group">
                <label>门店分类</label>
                <span class="">（门店分类）</span>
                <select name="catid" class="form-control">
                    {volist name='cat_list' id='vo'}
                    <option value="{$vo['id']}" {notempty name="info['catid']"}{if condition="$info['catid'] eq $vo['id']"} selected="selected" {/if}{/notempty} >{$vo['title']}</option>
                    {/volist}
                </select>
            </div>
        </div>
        <div class="col-md-6">
            <div class="form-group">
                <label>结算比例</label>
                <span class=""></span>
                <input class="form-control" name="bl" placeholder="请输入结算比例" value="{$info['bl']|default=''}" type="number">
            </div>
        </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label>补贴比例</label>
                    <span class=""></span>
                    <input class="form-control" name="btbl" placeholder="请输入分润比例" value="{$info['btbl']|default=''}" type="number">
                </div>
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label>利润比例</label>
                    <span class=""></span>
                    <input class="form-control" name="lrbl" placeholder="请输入利润比例" value="{$info['lrbl']|default=''}" type="number">
                </div>
            </div>
          <div class="col-md-6">
            <div class="form-group">
              <label>门店名称</label>
              <span class=""></span>
              <input class="form-control" name="title" placeholder="请输入门店名称" value="{$info['title']|default=''}" type="text">
            </div>
          </div>

            <div class="col-md-6">
            <div class="form-group">
              <label>联系电话</label>
              <span class=""></span>
              <input class="form-control" name="phone" placeholder="请输入门店联系电话" value="{$info['phone']|default=''}" type="text">
            </div>
          </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label>省市区</label>
                    <span class=""></span><br/>
                    <select name="county" id="county" class="form-control" style="width:30%;float:right;">
                        <option value="">区县</option>
                        {notempty name="clist"}
                        {volist name='alist' id='vo'}
                        <option value="{$vo['name']}" {notempty name="info['county']"}{if condition="$info['county'] eq $vo['name']"} selected="selected" {/if}{/notempty} >{$vo['name']}</option>
                        {/volist}
                        {/notempty}
                    </select>
                    <select name="city" id="city" class="form-control" style="width:30%;float:right;">
                        <option value="">市区</option>
                        {notempty name="clist"}
                        {volist name='clist' id='vo'}
                        <option value="{$vo['name']}" {notempty name="info['city']"}{if condition="$info['city'] eq $vo['name']"} selected="selected" {/if}{/notempty} >{$vo['name']}</option>
                        {/volist}
                        {/notempty}
                    </select>
                    <select name="province" id="province" class="form-control" style="width:30%;float:right;">
                        <option value="">省份</option>
                        {volist name='plist' id='vo'}
                        <option value="{$vo['name']}" {notempty name="info['province']"}{if condition="$info['province'] eq $vo['name']"} selected="selected" {/if}{/notempty} >{$vo['name']}</option>
                        {/volist}
                    </select>
                </div>
            </div>
		  <div class="col-md-6">
            <div class="form-group">
              <label>地址</label>
              <span class=""></span>
              <input class="form-control" name="address" placeholder="请输入门店地址" value="{$info['address']|default=''}" type="text">
            </div>
          </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label>银行</label>
                    <span class=""></span>
                    <input class="form-control" name="type" placeholder="如：招商银行、建设银行" value="{$info['type']|default=''}" type="text">
                </div>
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label>账户姓名</label>
                    <span class=""></span>
                    <input class="form-control" name="name" placeholder="请输入账户姓名" value="{$info['name']|default=''}" type="text">
                </div>
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label>银行卡号</label>
                    <span class=""></span>
                    <input class="form-control" name="account" placeholder="请输入账户" value="{$info['account']|default=''}" type="text">
                </div>
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label>微信收款码</label>
                    <span class="">（请上传单张图片）</span>
                    <br/>
                    {assign name="wx_id" value="$info.wx_id|default='0'" /}
                    {:widget('file/index', ['name' => 'wx_id', 'value' => $wx_id, 'type' => 'img'])}
                </div>
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label>支付宝收款码</label>
                    <span class="">（请上传单张图片）</span>
                    <br/>
                    {assign name="zfb_id" value="$info.zfb_id|default='0'" /}
                    {:widget('file/index', ['name' => 'zfb_id', 'value' => $zfb_id, 'type' => 'img'])}
                </div>
            </div>
          <div class="col-md-6">
            <div class="form-group">
                <label>门店主图</label>
                <span class="">（请上传单张图片）</span>
                <br/>
                {assign name="img_id" value="$info.img_id|default='0'" /}
                {:widget('file/index', ['name' => 'img_id', 'value' => $img_id, 'type' => 'img'])}
            </div>
          </div>
          <div class="col-md-6">
            <div class="form-group">
                <label>门店详情图</label>
                <span class="">（请上传1·5张图片）</span>
                <br/>              
                {assign name="img_ids" value="$info.img_ids|default=''" /}
                {:widget('file/index', ['name' => 'img_ids', 'value' => $img_ids, 'type' => 'imgs'])}               
            </div>         
          </div>
        </div>
      <div class="box-footer">
          
        <input type="hidden" name="id" value="{$info['id']|default='0'}"/>
        
        {include file="layout/edit_btn_group"/}
        
      </div>
       <script>
			$("input[name='username']").blur(function(){
				$.post("{:url('checkUsername')}",{username:$(this).val()},function(data){
					if(data.code == 0){
						$("#dian").html(data.name);
					}else{
						layer.msg(data.msg);
						$("input[name='username']").val('');
					}
				},'json')
			})
            $("#province").change(function(){
                var id=$(this).val();
                $.post("{:url('user_province')}",{id:id},function( data ){
                    if(data.code==0){
                        $("#city").html(data.html);
                    }else{
                        layer.msg(data.msg);
                    }
                },'json');
            });
            $("#city").change(function(){
                var id=$(this).val();
                $.post("{:url('user_city')}",{id:id},function( data ){
                    if(data!=""){
                        $("#county").html(data);
                    }else{
                        alert("未知错误！");
                    }
                });
            });
	   </script> 
      </div>
      </div>
</form>
